/*
    XTU OJ: 1042
    by: fifth_light
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int comp(char* a, char* b) {
    int i = 0;
    while (1) {
        if (a[i] == '\0' || b[i] == '\0') {
            break;
        }
        if (a[i] != b[i]) {
            return 0;
        }
        i++;
    }
    return 1;
}

int main(void) {
    int t;
    scanf("%d", &t);
    for(int i = 0; i < t; i++) {
        int n = 0;
        char strings[1000][1000];
        scanf(" ");
        int flag = 0;
        while (1) {
            int len = scanf("%1000[01]", strings[n]);
            if (len != 1) {
                break;
            }
            if (!flag) {
                for (int i = 0; i < n; i++) {
                    if (comp(strings[i], strings[n])) {
                        flag = 1;
                        break;
                    }
                }
            }
            n++;
            int ch = getchar();
            if (ch != ' ') {
                break;
            }
        }
        puts(flag ? "No" : "Yes");
    }
    return 0;
}
